<?php echo $header; ?>
<?php if ($this->error_warning) { ?>
	<div class="warning"><?php echo $this->error_warning; ?></div>
<?php } ?>
<?php if ($this->success) { ?>
<div class="success"><?php echo $this->success; ?></div>
<?php } ?>
<div class="box">
  <div class="left"></div>
  <div class="right"></div>
  <div class="heading">
    <h1 ><img src="/images/admin/language.png" alt=""><?php echo "Language" ?></h1>
    <div class="buttons"><a onclick="location = '<?php echo $this->insert; ?>'" class="button"><span><?php echo "Insert"; ?></span></a><a onclick="$('form').submit();" class="button"><span><?php echo "Delete"; ?></span></a></div>
  </div>
  <div class="content">
    <form action="<?php echo $this->delete; ?>" method="post" enctype="multipart/form-data" id="form">
      <table class="list">
        <thead>
          <tr>
            <td width="1" style="text-align: center;"><input type="checkbox" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);" /></td>
            <td class="left">
              <a href="#"><?php echo "Name"; ?></a>
            </td>
            <td class="left">
              <a href="#"><?php echo "Code"; ?></a>
			</td>
            <td class="right"><?php echo "Action"; ?></td>
          </tr>
        </thead>
        <tbody>
          <?php if ($this->languages) { ?>
          <?php foreach ($this->languages as $language) { ?>
          <tr>
            <td style="text-align: center;"><?php if ($language['selected']) { ?>
              <input type="checkbox" name="selected[]" value="<?php echo $language['language_id']; ?>" checked="checked" />
              <?php } else { ?>
              <input type="checkbox" name="selected[]" value="<?php echo $language['language_id']; ?>" />
              <?php } ?></td>
            <td class="left"><?php echo $language['name']; ?><?php if($language['default'] == 1){ echo ' <b>(Default)</b>';}?></td>
            <td class="left"><?php echo $language['code']; ?></td>
            <td class="right"><?php foreach ($language['action'] as $action) { ?>
              [ <a href="<?php echo $action['href']; ?>"><?php echo $action['text']; ?></a> ]
              <?php } ?></td>
          </tr>
          <?php } ?>
          <?php } else { ?>
          <tr>
            <td class="center" colspan="4"><?php echo "No "; ?></td>
          </tr>
          <?php } ?>
        </tbody>
      </table>
    </form>
  </div>
</div>
<?php echo $footer; ?>